//
//  ImageItemCell.m
//  Cycling
//
//  Created by 迟国强 on 2023/4/5.
//

#import "ImageItemCell.h"

@interface ImageItemCell ()

@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet UIButton *deleteButton;

@end

@implementation ImageItemCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
}

- (void)setDefaultImageName:(NSString *)defaultImageName
{
    self.iconImageView.image = [UIImage imageNamed:defaultImageName];
    self.deleteButton.hidden = YES;
}

- (void)setIconImage:(UIImage *)iconImage
{
    self.iconImageView.image = iconImage;
    self.deleteButton.hidden = NO;
}

- (IBAction)deleteButtonAction:(id)sender {
    if(self.deleteButtonBlock) {
        self.deleteButtonBlock(self.imageIndex);
    }
}


@end
